package com.seashell.appstartupjob.config;

import com.seashell.appstartupjob.enums.CopyType;
import com.seashell.appstartupjob.enums.DestinationPathType;
import com.seashell.appstartupjob.listener.AbstractApplicationStartupListener;
import com.seashell.appstartupjob.worker.IJobWorker;

import java.util.Set;


/**
 * com.seashell.appstartupjob.config.JarFileTransJobConfig
 * JarFile移动工作配置
 *
 * @author Allen
 * @version v1.0
 * @date 2017/7/10
 */
public class JarFileTransJobConfig implements IJobConfig{

    /**
     * 源地址表达式
     */
    private String expression;
    /**
     * 目标地址
     */
    private String destinationPath;

    /**
     * 目标地址类型
     */
    private DestinationPathType destinationPathType;
    /**
     * 包含
     */
    private Set<String> includes;
    /**
     * 排除
     */
    private Set<String> excludes;
    /**
     * 复制策略
     */
    private CopyType copyType;

    /**
     * 原始路径切掉的部分
     */
    private String resourcePathCut;

    /**
     * jar包内的一个class
     */
    private Class<? extends AbstractApplicationStartupListener> jarRefClass;

    /**
     * 工人类型
     */
    private Class<? extends IJobWorker> workerClass;

    public String getExpression() {
        return expression;
    }

    public void setExpression(String expression) {
        this.expression = expression;
    }

    public String getDestinationPath() {
        return destinationPath;
    }

    public void setDestinationPath(String destinationPath) {
        this.destinationPath = destinationPath;
    }

    public DestinationPathType getDestinationPathType() {
        return destinationPathType;
    }

    public void setDestinationPathType(DestinationPathType destinationPathType) {
        this.destinationPathType = destinationPathType;
    }

    public Set<String> getIncludes() {
        return includes;
    }

    public void setIncludes(Set<String> includes) {
        this.includes = includes;
    }

    public Set<String> getExcludes() {
        return excludes;
    }

    public void setExcludes(Set<String> excludes) {
        this.excludes = excludes;
    }

    public CopyType getCopyType() {
        return copyType;
    }

    public void setCopyType(CopyType copyType) {
        this.copyType = copyType;
    }

    public String getResourcePathCut() {
        return resourcePathCut;
    }

    public void setResourcePathCut(String resourcePathCut) {
        this.resourcePathCut = resourcePathCut;
    }

    public void setWorkerClass(Class<? extends IJobWorker> workerClass) {
        this.workerClass = workerClass;
    }

    @Override
    public Class<? extends IJobWorker> getWorker() {
        return workerClass;
    }

    public Class<? extends AbstractApplicationStartupListener> getJarRefClass() {
        return jarRefClass;
    }

    public void setJarRefClass(Class<? extends AbstractApplicationStartupListener> jarRefClass) {
        this.jarRefClass = jarRefClass;
    }
}
